<?php
/* This file is part of Mirasol CMS
   (C) 2014 by Chris Alban Hansen.
   Released under the terms of the GNU General Public License.
   See COPYING in the top level directory of the Mirasol CMS installation. */

require "{$_SERVER['DOCUMENT_ROOT']}/mirasol/lib/mirasol.php";

$app = new Mirasol ();

/* Is the Mirasol database installed? */
if (!$app->checkinstall ())
  $app->location ("install.php");
?>
<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="UTF-8" />
    <title>Login .:. <?php echo $app_name; ?></title>
    <link rel="icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64" href="./favicon.ico" />
    <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
    <link rel="stylesheet" href="<?php echo $app_adminpath; ?>/css/mirasol.css">
    <link rel="stylesheet" href="<?php echo $app_adminpath; ?>/css/login.css">
  </head>
  
  <body>
    <div id="login_box">
      
      <div id="login_form">
        <h3><?php echo $_SERVER['SERVER_NAME']; ?></h3>
          
        <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
          <fieldset>
            <div class="alignright"><button type="submit">Login</button></div>
            <div>
              <label for="username">Username:</label>
              <input type="text" name="username" id="username" maxlength="50"/><br/>
            </div>
            <div>
              <label for="passwd">Password:</label>
              <input type="password" name="passwd" id="passwd" maxlength="50"/>
            </div>
          </fieldset>
        </form>
          
        <p class="small center light"><?php echo $app_name; ?> version <?php echo $app_version; ?></p>
      </div>
        
    </div>
  </body>
</html>
